export default {
	methods: {
		reset({ reservedField = [] }) {
			for (const x in this.apiParams) {
				if (x === 'pageNo') {
					this.apiParams[x] = 1
				} else if (Array.isArray(this.apiParams[x])) {
					this.apiParams[x] = []
				} else if (x !== 'pageSize' && !reservedField.includes(x)) {
					this.apiParams[x] = ''
				}
			}
			this.getPageData()
		},
		filterData() {
			this.apiParams.pageNo = 1
			this.$nextTick(_ => {
				this.getPageData()
			})
		}
	}
}
